{% extends 'base.html' %}
{%  block title %}登录{% endblock %}

{% block body %}
    <div class="jumbotron text-center">
      <h1>智能共享平台</h1>
      <p>MLX@raspberrypi1</p>
    </div>
     <div class="container" style="width: 50%">
      <form class="form-signin text-center" action="/login/" method="POST">
        <h2 class="form-signin-heading">登录 sign in</h2>
        <label for="inputEmail" class="sr-only">Email address</label>
        <input type="email" name="email" class="form-control" placeholder="邮箱" required autofocus>
        <label for="inputPassword" class="sr-only">Password</label>
        <input type="password" name="password" class="form-control" placeholder="密码" required>

              <button type="button" onclick="go_add()" class="btn btn-default">注册</button>
              <button type="button" onclick="go_wagnji()" class="btn btn-default">忘记密码</button>

          <button id="seb_btn" onclick="login()" class="btn btn-lg btn-primary  btn-block"  type="submit" data-loading-text="Loading...">登录</button>
      </form>
        <div id="loa" class="text-center" style="display: none;">
          <div class="spinner-border" role="status">
            <span class="sr-only">Loading...</span>
          </div>
        </div>
    </div> <!-- /container -->
    <script>
        function go_add() {
        location.href="{% url 'add_user' %}"
    }
    function go_wagnji() {
        location.href="{% url 'no_open' %}"
    }
    function login(){
        document.getElementById("seb_btn").style.display="none";
        document.getElementById("loa").style.display="";
        setTimeout(load, 14000);
    }
    function load(){
        document.getElementById("seb_btn").style.display="";
        document.getElementById("loa").style.display="none";
        }
    </script>
{% endblock %}

